package FlowGraph.Nodes;

import antlr.collections.AST;

import util.Line;
import FlowGraph.FlowGraphNode;
import FlowGraph.StatementInfo.StatementInfo;

//////////////////////////////////////////////////////////////////////////
//// SyncBeginNode
/**

@author Ivan Jeukens
@version v 0.1 22/02/2002
*/
public class SyncBeginNode extends FlowGraphNode  {

    public SyncBeginNode(AST node) {
        super(node, SYNC_BEGIN, 1, 1);
        _expression = node.getFirstChild();

        _statementInfo = new StatementInfo(this, _expression);
    }

    ///////////////////////////////////////////////////////////////////
    ////                        public methods                     ////

    public String toString() {
        return new String("sync()");
    }
    
    public AST getExpression() {
       return _expression;
    }

    public void setSyncEnd(SyncEndNode node) {
        _syncEnd = node;
    }
    
    public SyncEndNode getSyncEnd() {
        return _syncEnd;
    }
    
    public void setBegLine(Line l) {
        _begLine = l;
    }

    public Line getBegLine() {
        return _begLine;
    }
    
    public void setEndLine(Line l) {
        _endLine = l;
    }
    
    public Line getEndLine() {
        return _endLine;
    }
    
    public StatementInfo getStatementInfo() {
        return _statementInfo;
    }

    ///////////////////////////////////////////////////////////////////
    ////                      private variables                    ////

    private AST _expression;

    private SyncEndNode _syncEnd;
    private Line _endLine;
    private Line _begLine;

    private StatementInfo _statementInfo;
}
